package com.atguigu.gmall.order.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.order.OrderInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@FeignClient(name = "service-order")
public interface OrderFeignClient {

    //获取清单
    @GetMapping("/api/order/auth/trade")
    public Map<String, Object> trade();

    /*//提交订单
    @PostMapping("/api/order/auth/submitOrder")
    public Result submitOrder(
            @RequestBody OrderInfo orderInfo,
            String tradeNo);//交易流水号为提交时生成，非前端页面传入，不用写注解*/

    //根据订单id获取订单信息
    @GetMapping("/api/order/getOrderInfo/{orderId}")
    public OrderInfo getOrderInfo(@PathVariable Long orderId);
    }
